package com.dmx.fw.exception;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2003-2-09</p>
 * <p>Company: </p>
 * @author siyipin
 * @version 1.0
 */
public abstract class AbstractException extends Exception{

    public static final String ERROR = "ERROR";
    public static final String WARNING = "WARNING";
    private String errorCode;
    private String errorDescription;
    private String errorLevel;

    public String getErrorCode(){
        return errorCode;
    }

    public String getErrorDescription(){
        return errorDescription;
    }

    public String getErrorLevel(){
        return errorLevel;
    }

    public String toString(){
        return "Error code:" + errorCode +
            " Error level:" + errorLevel +
            " Error description:" + errorDescription;
    }

    public AbstractException(){
    	
    }
    public AbstractException(String errorDesc){
        super(errorDesc);
        this.errorDescription = errorDesc;
        this.errorLevel = ERROR;
        this.errorCode = errorDesc;
    }

    public AbstractException(String errorCode, String errorDesc){
        super(errorCode);
        this.errorDescription = errorDesc;
        this.errorCode = errorCode;
        this.errorLevel = ERROR;
    }

    public AbstractException(String errorCode, String errorDesc, String errorLevel){
        super(errorCode);
        this.errorCode = errorCode;
        this.errorDescription = errorDesc;
        this.errorLevel = errorLevel;
    }
}
